package com.libraryinformation.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class TimeUtil {
    public static String convertDateToString(){
        //24小时制的格式
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        //当前 LocalDateTime 类型 时间
        LocalDateTime ldt = LocalDateTime.now();
        //转换为 String 类型
        String time24 = ldt.format(dtf);
        return time24;
    }
}
